from django.conf.urls import patterns, include, url

urlpatterns = patterns('MabiCommerce.views',
    url(r'^(?P<server_name>[\w ]+)/(?P<town_name>[\w ]+)/$', 'from_server'),
    url(r'^(?P<server_name>[\w ]+)/(?P<town_name>[\w ]+)/(?P<mode>[\w ]+)/$', 'from_server'),
    url(r'^(?P<ip>[\w \.]+)_(?P<port>\d+)/(?P<town_name>[\w ]+)/$', 'from_IP'),
    url(r'^(?P<ip>[\w \.]+)_(?P<port>\d+)/(?P<town_name>[\w ]+)/(?P<mode>[\w ]+)/$', 'from_IP'),
    url(r'^upload/(?P<server_name>[\w ]+)/(?P<town_name>[\w ]+)/json/$', 'to_server'),
    url(r'^upload/(?P<ip>[\w \.]+)_(?P<port>\d+)/(?P<town_name>[\w ]+)/json/$', 'to_IP'),
)